<?php
	include_once("db/PayStation.inc");
	include_once("db/AuditLogs.inc");
	
	$ps = new PayStation();
	
	$ps->payStationCode = $_REQUEST["id"];
	$ps->ministryId = $_REQUEST["ministryId"];
	$ps->deptCode = $_REQUEST["deptCode"];
	$ps->regionCode = $_REQUEST["region"];
	$ps->description = $_REQUEST["description"];
	
	$ps->provinceCode = $_REQUEST["province"];
	$ps->districtCode = $_REQUEST["district"];
	
	PayStation::updatePayStation($ps);
	AuditLogs::insertLog(User::getUser($_SESSION["uid"])->username, 'admin - modify pay station',
		"ID='".$ps->payStationCode."' Ministry='".$ps->ministryId."' Department='".$ps->deptCode.
		"' New Province='".$ps->provinceCode."' New District Code='".$ps->districtCode."'".
		" New Region='".$ps->regionCode."' New Description='".str_replace("'", "''", $ps->description)."'");
	
	header("Location: ./?action=viewPayStations");
?>